{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "71f615ad-a42b-4936-8955-768a76c9376c",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "25/06/23 16:48:52 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable\n",
      "Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties\n",
      "Setting default log level to \"WARN\".\n",
      "To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).\n",
      "25/06/23 16:48:53 WARN Utils: Service 'SparkUI' could not bind on port 4040. Attempting port 4041.\n",
      "25/06/23 16:48:53 WARN Utils: Service 'SparkUI' could not bind on port 4041. Attempting port 4042.\n"
     ]
    }
   ],
   "source": [
    "from pyspark.sql import SparkSession\n",
    "spark = SparkSession\\\n",
    "        .builder\\\n",
    "        .appName(\"hive-table-sample-20250620\")\\\n",
    "        .getOrCreate()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "8f93e3e6-608e-4d0e-9811-4dc4b78d6384",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "+-----------------------------------------------------------------------------------------------------------------+\n",
      "|substr(CAST(from_unixtime(CAST((1750403079 - ((8 * 60) * 60)) AS BIGINT), yyyy-MM-dd HH:mm:ss) AS STRING), 1, 10)|\n",
      "+-----------------------------------------------------------------------------------------------------------------+\n",
      "|                                                                                                       2025-06-20|\n",
      "+-----------------------------------------------------------------------------------------------------------------+\n",
      "\n"
     ]
    }
   ],
   "source": [
    "spark.sql(\"\"\"\n",
    "select SUBSTR(CAST(from_unixtime(1750403079-8*60*60) as string),1,10)\n",
    "\"\"\").show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "8965e975-a979-47e8-a8fb-21e03a6d4f52",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "                                                                                "
     ]
    }
   ],
   "source": [
    "df=spark.read.parquet('/Users/dob/Downloads/1')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "62d2a88e-a7ae-45a3-b68d-865f5c89f8ce",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<bound method DataFrame.printSchema of DataFrame[pageviewId: string, env: string, is_dpa: int, req_source: int, sid: string, processTime: bigint, campaignId: bigint, adsetId: bigint, adGroupId: bigint, adPositionId: bigint, isOffline: int, isNewCache: int, geoCode: string, geoCodeIp: string, uid: string, beylaId: string, gaid: string, creativeId: bigint, orderId: bigint, impUrlIndex: int, dspName: string, dspPosId: string, targetGame: string, targetScene: string, targetRoom: string, targetKeyword: string, adClass: int, loadType: int, companyId: int, gbCode: string, country: string, resourceFreqControlMode: int, adImpressionCount: int, jstagTrueViewCount: int, configId: bigint, accountId: bigint, blockIds: array<string>, strBlockIds: string, itemId: bigint, bidType: int, bidPrice: bigint, actualBidPrice: bigint, displayType: int, algVer: int, algSubVer: int, algFileVer: int, pctr: float, revenue: bigint, actualRevenue: bigint, jstagImpType: string, element: string, appKey: string, appName: string, appType: int, appId: string, appVersion: string, appVer: bigint, isOneshot: int, ecpm: bigint, requestChannelType: int, adnRid: string, midasVersion: string, packageName: string, trafficType: int, objective: int, test_infos: array<string>, apkSelectInfo: string, so_line_id: bigint, gameId: string, oem_pos_id: string, action_type: int, dspType: string, cpu_bit: string, dsp_name_new: string, traffic_level: string, gp_type: int, offer_id: string, dsp_id: string, sdkVer: bigint, is_internal: string, otherInfo: map<string,string>, req_time: bigint, manufacturer: string, is_new_ad: int, flow_status: int, algo_random_traffic: int, strategyId: int, eventTime: bigint, dspCampId: string, dspCId: string, report_code: int, new_ad_action: int, cta_version: string, lp_type: int]>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.printSchema"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "eeefc617-5a44-42d4-9403-dc1be8bda032",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "25/06/24 01:45:24 WARN HeartbeatReceiver: Removing executor driver with no recent heartbeats: 7206361 ms exceeds timeout 120000 ms\n",
      "25/06/24 01:45:24 WARN SparkContext: Killing executors is not supported by current scheduler.\n"
     ]
    }
   ],
   "source": [
    "a='array<string>'\n",
    "print(a.startswith('array'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "59d50e1a-bcf1-4c7c-a13b-371e02144af5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'{\"total\":0,\"code\":0,\"data\":{\"byteSize\":null,\"userGroupUUid\":null,\"lastActivityCount\":null,\"subject\":null,\"dbName\":\"ads_dmp\",\"num\":null,\"dbTable\":null,\"targetTagName\":null,\"clearCache\":null,\"type\":null,\"latestPartitionName\":null,\"tableName\":\"dim_ads_midas_t_campaign_push_strategy\",\"lifecycle\":0,\"score\":null,\"partitionCount\":null,\"userList\":null,\"hierarchical\":null,\"limit\":0,\"id\":null,\"partitionKeys\":null,\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"listCategory\":null,\"listModel\":null,\"targetModelCategoryId\":null,\"recentVisitCount\":null,\"sdFileFormat\":null,\"count\":null,\"targetTagCategoryId\":null,\"sort\":null,\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"partitionType\":0,\"tags\":null,\"catalogName\":\"shareit_sg1\",\"cnName\":null,\"size\":null,\"name\":\"dim_ads_midas_t_campaign_push_strategy\",\"interval\":null,\"page\":0,\"pageToken\":null,\"region\":\"sg1\",\"collect\":null,\"status\":0,\"sourceTagCategoryId\":null,\"useDirection\":null,\"flag\":0,\"numRows\":null,\"listTag\":null,\"columns\":\"[{\\\\\"name\\\\\":\\\\\"id\\\\\",\\\\\"comment\\\\\":\\\\\"\\\\\",\\\\\"type\\\\\":\\\\\"INT\\\\\"}, {\\\\\"name\\\\\":\\\\\"name\\\\\",\\\\\"comment\\\\\":\\\\\"策略id\\\\\",\\\\\"type\\\\\":\\\\\"STRING\\\\\"}, {\\\\\"name\\\\\":\\\\\"push_limit\\\\\",\\\\\"comment\\\\\":\\\\\"push 控量cap\\\\\",\\\\\"type\\\\\":\\\\\"INT\\\\\"}, {\\\\\"name\\\\\":\\\\\"push_target\\\\\",\\\\\"comment\\\\\":\\\\\"push目标 1、reengagement拉活 2、cpi订单未归因拉活 3、cpi订单转化效果提升 3、\\\\\",\\\\\"type\\\\\":\\\\\"INT\\\\\"}, {\\\\\"name\\\\\":\\\\\"status\\\\\",\\\\\"comment\\\\\":\\\\\"状态：1 有效  -1 删除\\\\\",\\\\\"type\\\\\":\\\\\"INT\\\\\"}, {\\\\\"name\\\\\":\\\\\"strategy_type\\\\\",\\\\\"comment\\\\\":\\\\\"1、push目标策略 2、push id策略\\\\\",\\\\\"type\\\\\":\\\\\"INT\\\\\"}, {\\\\\"name\\\\\":\\\\\"push_id\\\\\",\\\\\"comment\\\\\":\\\\\"push id\\\\\",\\\\\"type\\\\\":\\\\\"INT\\\\\"}, {\\\\\"name\\\\\":\\\\\"account_id\\\\\",\\\\\"comment\\\\\":\\\\\"账户id\\\\\",\\\\\"type\\\\\":\\\\\"INT\\\\\"}, {\\\\\"name\\\\\":\\\\\"create_user_id\\\\\",\\\\\"comment\\\\\":\\\\\"创建者id\\\\\",\\\\\"type\\\\\":\\\\\"INT\\\\\"}, {\\\\\"name\\\\\":\\\\\"modify_user_id\\\\\",\\\\\"comment\\\\\":\\\\\"修改人id\\\\\",\\\\\"type\\\\\":\\\\\"INT\\\\\"}, {\\\\\"name\\\\\":\\\\\"create_time\\\\\",\\\\\"comment\\\\\":\\\\\"创建时间\\\\\",\\\\\"type\\\\\":\\\\\"STRING\\\\\"}, {\\\\\"name\\\\\":\\\\\"modify_time\\\\\",\\\\\"comment\\\\\":\\\\\"修改时间\\\\\",\\\\\"type\\\\\":\\\\\"STRING\\\\\"}]\",\"description\":\"\",\"createType\":0,\"title\":null,\"sql\":null,\"securityLevel\":null,\"sourceModelCategoryId\":null,\"tableType\":\"外部表\",\"nextMarker\":null,\"columnsObj\":null,\"partitionKeysObj\":null,\"tenantName\":null,\"provider\":\"Hive\",\"transientLastDdlTime\":null,\"columnsList\":null,\"key\":\"sg1.ads_dmp.dim_ads_midas_t_campaign_push_strategy\",\"owner\":\"qijuhong\",\"sole\":\"sg1.ads_dmp.dim_ads_midas_t_campaign_push_strategy\",\"collectTime\":null,\"fileDelimiter\":null,\"lastAccessTime\":null,\"previousMarker\":null,\"partitionKeyList\":[],\"columnList\":[{\"colType\":\"INT\",\"comment\":\"\",\"columnName\":\"id\"},{\"colType\":\"STRING\",\"comment\":\"策略id\",\"columnName\":\"name\"},{\"colType\":\"INT\",\"comment\":\"push 控量cap\",\"columnName\":\"push_limit\"},{\"colType\":\"INT\",\"comment\":\"push目标 1、reengagement拉活 2、cpi订单未归因拉活 3、cpi订单转化效果提升 3、\",\"columnName\":\"push_target\"},{\"colType\":\"INT\",\"comment\":\"状态：1 有效  -1 删除\",\"columnName\":\"status\"},{\"colType\":\"INT\",\"comment\":\"1、push目标策略 2、push id策略\",\"columnName\":\"strategy_type\"},{\"colType\":\"INT\",\"comment\":\"push id\",\"columnName\":\"push_id\"},{\"colType\":\"INT\",\"comment\":\"账户id\",\"columnName\":\"account_id\"},{\"colType\":\"INT\",\"comment\":\"创建者id\",\"columnName\":\"create_user_id\"},{\"colType\":\"INT\",\"comment\":\"修改人id\",\"columnName\":\"modify_user_id\"},{\"colType\":\"STRING\",\"comment\":\"创建时间\",\"columnName\":\"create_time\"},{\"colType\":\"STRING\",\"comment\":\"修改时间\",\"columnName\":\"modify_time\"}],\"updateTime\":\"2025-06-05 19:34:36\",\"userName\":null,\"userId\":null,\"keyWord\":null,\"tagList\":null,\"secondaryKeywords\":null,\"createBy\":null,\"application\":null,\"createTime\":\"2023-06-08 03:20:48\",\"keyWordForSearch\":null,\"storageType\":\"S3\",\"location\":\"s3://shareit.ads.ap-southeast-1/dw/table/dim/dim_ads_midas_t_campaign_push_strategy_part/dt=2025021010\",\"categoryId\":null,\"fileFormat\":\"S3,parquet\",\"updateType\":null},\"limit\":0,\"page\":0,\"message\":\"success\"}'"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hive_json_str = r\"\"\"\n",
    "        {\"total\":0,\"code\":0,\"data\":{\"byteSize\":null,\"userGroupUUid\":null,\"lastActivityCount\":null,\"subject\":null,\"dbName\":\"ads_dmp\",\"num\":null,\"dbTable\":null,\"targetTagName\":null,\"clearCache\":null,\"type\":null,\"latestPartitionName\":null,\"tableName\":\"dim_ads_midas_t_campaign_push_strategy\",\"lifecycle\":0,\"score\":null,\"partitionCount\":null,\"userList\":null,\"hierarchical\":null,\"limit\":0,\"id\":null,\"partitionKeys\":null,\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"listCategory\":null,\"listModel\":null,\"targetModelCategoryId\":null,\"recentVisitCount\":null,\"sdFileFormat\":null,\"count\":null,\"targetTagCategoryId\":null,\"sort\":null,\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"partitionType\":0,\"tags\":null,\"catalogName\":\"shareit_sg1\",\"cnName\":null,\"size\":null,\"name\":\"dim_ads_midas_t_campaign_push_strategy\",\"interval\":null,\"page\":0,\"pageToken\":null,\"region\":\"sg1\",\"collect\":null,\"status\":0,\"sourceTagCategoryId\":null,\"useDirection\":null,\"flag\":0,\"numRows\":null,\"listTag\":null,\"columns\":\"[{\\\"name\\\":\\\"id\\\",\\\"comment\\\":\\\"\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"name\\\",\\\"comment\\\":\\\"策略id\\\",\\\"type\\\":\\\"STRING\\\"}, {\\\"name\\\":\\\"push_limit\\\",\\\"comment\\\":\\\"push 控量cap\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"push_target\\\",\\\"comment\\\":\\\"push目标 1、reengagement拉活 2、cpi订单未归因拉活 3、cpi订单转化效果提升 3、\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"status\\\",\\\"comment\\\":\\\"状态：1 有效  -1 删除\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"strategy_type\\\",\\\"comment\\\":\\\"1、push目标策略 2、push id策略\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"push_id\\\",\\\"comment\\\":\\\"push id\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"account_id\\\",\\\"comment\\\":\\\"账户id\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"create_user_id\\\",\\\"comment\\\":\\\"创建者id\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"modify_user_id\\\",\\\"comment\\\":\\\"修改人id\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"create_time\\\",\\\"comment\\\":\\\"创建时间\\\",\\\"type\\\":\\\"STRING\\\"}, {\\\"name\\\":\\\"modify_time\\\",\\\"comment\\\":\\\"修改时间\\\",\\\"type\\\":\\\"STRING\\\"}]\",\"description\":\"\",\"createType\":0,\"title\":null,\"sql\":null,\"securityLevel\":null,\"sourceModelCategoryId\":null,\"tableType\":\"外部表\",\"nextMarker\":null,\"columnsObj\":null,\"partitionKeysObj\":null,\"tenantName\":null,\"provider\":\"Hive\",\"transientLastDdlTime\":null,\"columnsList\":null,\"key\":\"sg1.ads_dmp.dim_ads_midas_t_campaign_push_strategy\",\"owner\":\"qijuhong\",\"sole\":\"sg1.ads_dmp.dim_ads_midas_t_campaign_push_strategy\",\"collectTime\":null,\"fileDelimiter\":null,\"lastAccessTime\":null,\"previousMarker\":null,\"partitionKeyList\":[],\"columnList\":[{\"colType\":\"INT\",\"comment\":\"\",\"columnName\":\"id\"},{\"colType\":\"STRING\",\"comment\":\"策略id\",\"columnName\":\"name\"},{\"colType\":\"INT\",\"comment\":\"push 控量cap\",\"columnName\":\"push_limit\"},{\"colType\":\"INT\",\"comment\":\"push目标 1、reengagement拉活 2、cpi订单未归因拉活 3、cpi订单转化效果提升 3、\",\"columnName\":\"push_target\"},{\"colType\":\"INT\",\"comment\":\"状态：1 有效  -1 删除\",\"columnName\":\"status\"},{\"colType\":\"INT\",\"comment\":\"1、push目标策略 2、push id策略\",\"columnName\":\"strategy_type\"},{\"colType\":\"INT\",\"comment\":\"push id\",\"columnName\":\"push_id\"},{\"colType\":\"INT\",\"comment\":\"账户id\",\"columnName\":\"account_id\"},{\"colType\":\"INT\",\"comment\":\"创建者id\",\"columnName\":\"create_user_id\"},{\"colType\":\"INT\",\"comment\":\"修改人id\",\"columnName\":\"modify_user_id\"},{\"colType\":\"STRING\",\"comment\":\"创建时间\",\"columnName\":\"create_time\"},{\"colType\":\"STRING\",\"comment\":\"修改时间\",\"columnName\":\"modify_time\"}],\"updateTime\":\"2025-06-05 19:34:36\",\"userName\":null,\"userId\":null,\"keyWord\":null,\"tagList\":null,\"secondaryKeywords\":null,\"createBy\":null,\"application\":null,\"createTime\":\"2023-06-08 03:20:48\",\"keyWordForSearch\":null,\"storageType\":\"S3\",\"location\":\"s3://shareit.ads.ap-southeast-1/dw/table/dim/dim_ads_midas_t_campaign_push_strategy_part/dt=2025021010\",\"categoryId\":null,\"fileFormat\":\"S3,parquet\",\"updateType\":null},\"limit\":0,\"page\":0,\"message\":\"success\"}\n",
    "        \"\"\".strip()\n",
    "hive_json_str"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "86c81fe0-2196-4123-937d-d9a18607454e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'total': 0,\n",
       " 'code': 0,\n",
       " 'data': {'byteSize': None,\n",
       "  'userGroupUUid': None,\n",
       "  'lastActivityCount': None,\n",
       "  'subject': None,\n",
       "  'dbName': 'ads_dmp',\n",
       "  'num': None,\n",
       "  'dbTable': None,\n",
       "  'targetTagName': None,\n",
       "  'clearCache': None,\n",
       "  'type': None,\n",
       "  'latestPartitionName': None,\n",
       "  'tableName': 'dim_ads_midas_t_campaign_push_strategy',\n",
       "  'lifecycle': 0,\n",
       "  'score': None,\n",
       "  'partitionCount': None,\n",
       "  'userList': None,\n",
       "  'hierarchical': None,\n",
       "  'limit': 0,\n",
       "  'id': None,\n",
       "  'partitionKeys': None,\n",
       "  'outputFormat': 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat',\n",
       "  'listCategory': None,\n",
       "  'listModel': None,\n",
       "  'targetModelCategoryId': None,\n",
       "  'recentVisitCount': None,\n",
       "  'sdFileFormat': None,\n",
       "  'count': None,\n",
       "  'targetTagCategoryId': None,\n",
       "  'sort': None,\n",
       "  'inputFormat': 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat',\n",
       "  'partitionType': 0,\n",
       "  'tags': None,\n",
       "  'catalogName': 'shareit_sg1',\n",
       "  'cnName': None,\n",
       "  'size': None,\n",
       "  'name': 'dim_ads_midas_t_campaign_push_strategy',\n",
       "  'interval': None,\n",
       "  'page': 0,\n",
       "  'pageToken': None,\n",
       "  'region': 'sg1',\n",
       "  'collect': None,\n",
       "  'status': 0,\n",
       "  'sourceTagCategoryId': None,\n",
       "  'useDirection': None,\n",
       "  'flag': 0,\n",
       "  'numRows': None,\n",
       "  'listTag': None,\n",
       "  'columns': '[{\"name\":\"id\",\"comment\":\"\",\"type\":\"INT\"}, {\"name\":\"name\",\"comment\":\"策略id\",\"type\":\"STRING\"}, {\"name\":\"push_limit\",\"comment\":\"push 控量cap\",\"type\":\"INT\"}, {\"name\":\"push_target\",\"comment\":\"push目标 1、reengagement拉活 2、cpi订单未归因拉活 3、cpi订单转化效果提升 3、\",\"type\":\"INT\"}, {\"name\":\"status\",\"comment\":\"状态：1 有效  -1 删除\",\"type\":\"INT\"}, {\"name\":\"strategy_type\",\"comment\":\"1、push目标策略 2、push id策略\",\"type\":\"INT\"}, {\"name\":\"push_id\",\"comment\":\"push id\",\"type\":\"INT\"}, {\"name\":\"account_id\",\"comment\":\"账户id\",\"type\":\"INT\"}, {\"name\":\"create_user_id\",\"comment\":\"创建者id\",\"type\":\"INT\"}, {\"name\":\"modify_user_id\",\"comment\":\"修改人id\",\"type\":\"INT\"}, {\"name\":\"create_time\",\"comment\":\"创建时间\",\"type\":\"STRING\"}, {\"name\":\"modify_time\",\"comment\":\"修改时间\",\"type\":\"STRING\"}]',\n",
       "  'description': '',\n",
       "  'createType': 0,\n",
       "  'title': None,\n",
       "  'sql': None,\n",
       "  'securityLevel': None,\n",
       "  'sourceModelCategoryId': None,\n",
       "  'tableType': '外部表',\n",
       "  'nextMarker': None,\n",
       "  'columnsObj': None,\n",
       "  'partitionKeysObj': None,\n",
       "  'tenantName': None,\n",
       "  'provider': 'Hive',\n",
       "  'transientLastDdlTime': None,\n",
       "  'columnsList': None,\n",
       "  'key': 'sg1.ads_dmp.dim_ads_midas_t_campaign_push_strategy',\n",
       "  'owner': 'qijuhong',\n",
       "  'sole': 'sg1.ads_dmp.dim_ads_midas_t_campaign_push_strategy',\n",
       "  'collectTime': None,\n",
       "  'fileDelimiter': None,\n",
       "  'lastAccessTime': None,\n",
       "  'previousMarker': None,\n",
       "  'partitionKeyList': [],\n",
       "  'columnList': [{'colType': 'INT', 'comment': '', 'columnName': 'id'},\n",
       "   {'colType': 'STRING', 'comment': '策略id', 'columnName': 'name'},\n",
       "   {'colType': 'INT', 'comment': 'push 控量cap', 'columnName': 'push_limit'},\n",
       "   {'colType': 'INT',\n",
       "    'comment': 'push目标 1、reengagement拉活 2、cpi订单未归因拉活 3、cpi订单转化效果提升 3、',\n",
       "    'columnName': 'push_target'},\n",
       "   {'colType': 'INT', 'comment': '状态：1 有效  -1 删除', 'columnName': 'status'},\n",
       "   {'colType': 'INT',\n",
       "    'comment': '1、push目标策略 2、push id策略',\n",
       "    'columnName': 'strategy_type'},\n",
       "   {'colType': 'INT', 'comment': 'push id', 'columnName': 'push_id'},\n",
       "   {'colType': 'INT', 'comment': '账户id', 'columnName': 'account_id'},\n",
       "   {'colType': 'INT', 'comment': '创建者id', 'columnName': 'create_user_id'},\n",
       "   {'colType': 'INT', 'comment': '修改人id', 'columnName': 'modify_user_id'},\n",
       "   {'colType': 'STRING', 'comment': '创建时间', 'columnName': 'create_time'},\n",
       "   {'colType': 'STRING', 'comment': '修改时间', 'columnName': 'modify_time'}],\n",
       "  'updateTime': '2025-06-05 19:34:36',\n",
       "  'userName': None,\n",
       "  'userId': None,\n",
       "  'keyWord': None,\n",
       "  'tagList': None,\n",
       "  'secondaryKeywords': None,\n",
       "  'createBy': None,\n",
       "  'application': None,\n",
       "  'createTime': '2023-06-08 03:20:48',\n",
       "  'keyWordForSearch': None,\n",
       "  'storageType': 'S3',\n",
       "  'location': 's3://shareit.ads.ap-southeast-1/dw/table/dim/dim_ads_midas_t_campaign_push_strategy_part/dt=2025021010',\n",
       "  'categoryId': None,\n",
       "  'fileFormat': 'S3,parquet',\n",
       "  'updateType': None},\n",
       " 'limit': 0,\n",
       " 'page': 0,\n",
       " 'message': 'success'}"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import json\n",
    "hive_data = json.loads(hive_json_str)\n",
    "hive_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "98347618-953c-484d-af56-135367cb2ab5",
   "metadata": {},
   "outputs": [
    {
     "ename": "JSONDecodeError",
     "evalue": "Expecting ',' delimiter: line 1 column 41 (char 40)",
     "output_type": "error",
     "traceback": [
      "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
      "\u001b[31mJSONDecodeError\u001b[39m                           Traceback (most recent call last)",
      "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[20]\u001b[39m\u001b[32m, line 4\u001b[39m\n\u001b[32m      2\u001b[39m a = \u001b[33m'\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mtotal\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:0,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcode\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:0,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mdata\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mbyteSize\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33muserGroupUUid\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mlastActivityCount\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msubject\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mdbName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mads_dmp\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mnum\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mdbTable\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mtargetTagName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mclearCache\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mtype\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mlatestPartitionName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mtableName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mdim_ads_midas_t_campaign_push_strategy\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mlifecycle\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:0,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mscore\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpartitionCount\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33muserList\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mhierarchical\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mlimit\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:0,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mid\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpartitionKeys\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33moutputFormat\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33morg.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mlistCategory\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mlistModel\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mtargetModelCategoryId\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mrecentVisitCount\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msdFileFormat\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcount\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mtargetTagCategoryId\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msort\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33minputFormat\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33morg.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpartitionType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:0,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mtags\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcatalogName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mshareit_sg1\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcnName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msize\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mname\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mdim_ads_midas_t_campaign_push_strategy\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33minterval\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpage\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:0,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpageToken\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mregion\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msg1\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcollect\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mstatus\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:0,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msourceTagCategoryId\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33museDirection\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mflag\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:0,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mnumRows\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mlistTag\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumns\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m[]\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mdescription\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcreateType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:0,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mtitle\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msql\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msecurityLevel\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msourceModelCategoryId\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mtableType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m外部表\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mnextMarker\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnsObj\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpartitionKeysObj\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mtenantName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mprovider\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mHive\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mtransientLastDdlTime\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnsList\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mkey\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msg1.ads_dmp.dim_ads_midas_t_campaign_push_strategy\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mowner\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mqijuhong\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msole\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msg1.ads_dmp.dim_ads_midas_t_campaign_push_strategy\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcollectTime\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mfileDelimiter\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mlastAccessTime\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpreviousMarker\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpartitionKeyList\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:[],\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnList\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:[\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mINT\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcomment\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mid\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m},\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mSTRING\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcomment\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m策略id\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mname\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m},\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mINT\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcomment\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpush 控量cap\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpush_limit\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m},\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mINT\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcomment\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpush目标 1、reengagement拉活 2、cpi订单未归因拉活 3、cpi订单转化效果提升 3、\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpush_target\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m},\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mINT\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcomment\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m状态：1 有效  -1 删除\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mstatus\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m},\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mINT\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcomment\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m1、push目标策略 2、push id策略\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mstrategy_type\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m},\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mINT\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcomment\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpush id\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpush_id\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m},\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mINT\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcomment\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m账户id\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33maccount_id\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m},\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mINT\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcomment\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m创建者id\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcreate_user_id\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m},\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mINT\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcomment\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m修改人id\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mmodify_user_id\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m},\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mSTRING\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcomment\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m创建时间\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcreate_time\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m},\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mSTRING\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcomment\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m修改时间\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumnName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mmodify_time\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m}],\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mupdateTime\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m2025-06-05 19:34:36\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33muserName\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33muserId\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mkeyWord\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mtagList\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msecondaryKeywords\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcreateBy\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mapplication\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcreateTime\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m2023-06-08 03:20:48\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mkeyWordForSearch\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mstorageType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mS3\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mlocation\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33ms3://shareit.ads.ap-southeast-1/dw/table/dim/dim_ads_midas_t_campaign_push_strategy_part/dt=2025021010\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcategoryId\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mfileFormat\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mS3,parquet\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mupdateType\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null},\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mlimit\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:0,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mpage\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:0,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mmessage\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33msuccess\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m}\u001b[39m\u001b[33m'\u001b[39m\n\u001b[32m      3\u001b[39m a = \u001b[33m'\u001b[39m\u001b[33m{\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mtotal\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:0,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mlistTag\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:null,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mcolumns\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m[\u001b[39m\u001b[33m{\u001b[39m\u001b[38;5;130;01m\\\"\u001b[39;00m\u001b[33mname\u001b[39m\u001b[38;5;130;01m\\\"\u001b[39;00m\u001b[33m:\u001b[39m\u001b[38;5;130;01m\\\"\u001b[39;00m\u001b[33mid\u001b[39m\u001b[38;5;130;01m\\\"\u001b[39;00m\u001b[33m,\u001b[39m\u001b[38;5;130;01m\\\"\u001b[39;00m\u001b[33mcomment\u001b[39m\u001b[38;5;130;01m\\\"\u001b[39;00m\u001b[33m:\u001b[39m\u001b[38;5;130;01m\\\"\u001b[39;00m\u001b[38;5;130;01m\\\"\u001b[39;00m\u001b[33m,\u001b[39m\u001b[38;5;130;01m\\\"\u001b[39;00m\u001b[33mtype\u001b[39m\u001b[38;5;130;01m\\\"\u001b[39;00m\u001b[33m:\u001b[39m\u001b[38;5;130;01m\\\"\u001b[39;00m\u001b[33mINT\u001b[39m\u001b[38;5;130;01m\\\"\u001b[39;00m\u001b[33m}]\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m,\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mdescription\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m}\u001b[39m\u001b[33m'\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m4\u001b[39m json.loads(a)\n",
      "\u001b[36mFile \u001b[39m\u001b[32m/usr/local/Caskroom/miniconda/base/lib/python3.13/json/__init__.py:346\u001b[39m, in \u001b[36mloads\u001b[39m\u001b[34m(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)\u001b[39m\n\u001b[32m    341\u001b[39m     s = s.decode(detect_encoding(s), \u001b[33m'\u001b[39m\u001b[33msurrogatepass\u001b[39m\u001b[33m'\u001b[39m)\n\u001b[32m    343\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m (\u001b[38;5;28mcls\u001b[39m \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m object_hook \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m\n\u001b[32m    344\u001b[39m         parse_int \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m parse_float \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m\n\u001b[32m    345\u001b[39m         parse_constant \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m object_pairs_hook \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m kw):\n\u001b[32m--> \u001b[39m\u001b[32m346\u001b[39m     \u001b[38;5;28;01mreturn\u001b[39;00m _default_decoder.decode(s)\n\u001b[32m    347\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mcls\u001b[39m \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m    348\u001b[39m     \u001b[38;5;28mcls\u001b[39m = JSONDecoder\n",
      "\u001b[36mFile \u001b[39m\u001b[32m/usr/local/Caskroom/miniconda/base/lib/python3.13/json/decoder.py:345\u001b[39m, in \u001b[36mJSONDecoder.decode\u001b[39m\u001b[34m(self, s, _w)\u001b[39m\n\u001b[32m    340\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mdecode\u001b[39m(\u001b[38;5;28mself\u001b[39m, s, _w=WHITESPACE.match):\n\u001b[32m    341\u001b[39m \u001b[38;5;250m    \u001b[39m\u001b[33;03m\"\"\"Return the Python representation of ``s`` (a ``str`` instance\u001b[39;00m\n\u001b[32m    342\u001b[39m \u001b[33;03m    containing a JSON document).\u001b[39;00m\n\u001b[32m    343\u001b[39m \n\u001b[32m    344\u001b[39m \u001b[33;03m    \"\"\"\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m345\u001b[39m     obj, end = \u001b[38;5;28mself\u001b[39m.raw_decode(s, idx=_w(s, \u001b[32m0\u001b[39m).end())\n\u001b[32m    346\u001b[39m     end = _w(s, end).end()\n\u001b[32m    347\u001b[39m     \u001b[38;5;28;01mif\u001b[39;00m end != \u001b[38;5;28mlen\u001b[39m(s):\n",
      "\u001b[36mFile \u001b[39m\u001b[32m/usr/local/Caskroom/miniconda/base/lib/python3.13/json/decoder.py:361\u001b[39m, in \u001b[36mJSONDecoder.raw_decode\u001b[39m\u001b[34m(self, s, idx)\u001b[39m\n\u001b[32m    352\u001b[39m \u001b[38;5;250m\u001b[39m\u001b[33;03m\"\"\"Decode a JSON document from ``s`` (a ``str`` beginning with\u001b[39;00m\n\u001b[32m    353\u001b[39m \u001b[33;03ma JSON document) and return a 2-tuple of the Python\u001b[39;00m\n\u001b[32m    354\u001b[39m \u001b[33;03mrepresentation and the index in ``s`` where the document ended.\u001b[39;00m\n\u001b[32m   (...)\u001b[39m\u001b[32m    358\u001b[39m \n\u001b[32m    359\u001b[39m \u001b[33;03m\"\"\"\u001b[39;00m\n\u001b[32m    360\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m361\u001b[39m     obj, end = \u001b[38;5;28mself\u001b[39m.scan_once(s, idx)\n\u001b[32m    362\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mStopIteration\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[32m    363\u001b[39m     \u001b[38;5;28;01mraise\u001b[39;00m JSONDecodeError(\u001b[33m\"\u001b[39m\u001b[33mExpecting value\u001b[39m\u001b[33m\"\u001b[39m, s, err.value) \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m\n",
      "\u001b[31mJSONDecodeError\u001b[39m: Expecting ',' delimiter: line 1 column 41 (char 40)"
     ]
    }
   ],
   "source": [
    "a = '{\"total\":0,\"code\":0,\"data\":{\"byteSize\":null,\"userGroupUUid\":null,\"lastActivityCount\":null,\"subject\":null,\"dbName\":\"ads_dmp\",\"num\":null,\"dbTable\":null,\"targetTagName\":null,\"clearCache\":null,\"type\":null,\"latestPartitionName\":null,\"tableName\":\"dim_ads_midas_t_campaign_push_strategy\",\"lifecycle\":0,\"score\":null,\"partitionCount\":null,\"userList\":null,\"hierarchical\":null,\"limit\":0,\"id\":null,\"partitionKeys\":null,\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"listCategory\":null,\"listModel\":null,\"targetModelCategoryId\":null,\"recentVisitCount\":null,\"sdFileFormat\":null,\"count\":null,\"targetTagCategoryId\":null,\"sort\":null,\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"partitionType\":0,\"tags\":null,\"catalogName\":\"shareit_sg1\",\"cnName\":null,\"size\":null,\"name\":\"dim_ads_midas_t_campaign_push_strategy\",\"interval\":null,\"page\":0,\"pageToken\":null,\"region\":\"sg1\",\"collect\":null,\"status\":0,\"sourceTagCategoryId\":null,\"useDirection\":null,\"flag\":0,\"numRows\":null,\"listTag\":null,\"columns\":\"[{\\\"name\\\":\\\"id\\\",\\\"comment\\\":\\\"\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"name\\\",\\\"comment\\\":\\\"策略id\\\",\\\"type\\\":\\\"STRING\\\"}, {\\\"name\\\":\\\"push_limit\\\",\\\"comment\\\":\\\"push 控量cap\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"push_target\\\",\\\"comment\\\":\\\"push目标 1、reengagement拉活 2、cpi订单未归因拉活 3、cpi订单转化效果提升 3、\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"status\\\",\\\"comment\\\":\\\"状态：1 有效  -1 删除\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"strategy_type\\\",\\\"comment\\\":\\\"1、push目标策略 2、push id策略\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"push_id\\\",\\\"comment\\\":\\\"push id\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"account_id\\\",\\\"comment\\\":\\\"账户id\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"create_user_id\\\",\\\"comment\\\":\\\"创建者id\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"modify_user_id\\\",\\\"comment\\\":\\\"修改人id\\\",\\\"type\\\":\\\"INT\\\"}, {\\\"name\\\":\\\"create_time\\\",\\\"comment\\\":\\\"创建时间\\\",\\\"type\\\":\\\"STRING\\\"}, {\\\"name\\\":\\\"modify_time\\\",\\\"comment\\\":\\\"修改时间\\\",\\\"type\\\":\\\"STRING\\\"}]\",\"description\":\"\",\"createType\":0,\"title\":null,\"sql\":null,\"securityLevel\":null,\"sourceModelCategoryId\":null,\"tableType\":\"外部表\",\"nextMarker\":null,\"columnsObj\":null,\"partitionKeysObj\":null,\"tenantName\":null,\"provider\":\"Hive\",\"transientLastDdlTime\":null,\"columnsList\":null,\"key\":\"sg1.ads_dmp.dim_ads_midas_t_campaign_push_strategy\",\"owner\":\"qijuhong\",\"sole\":\"sg1.ads_dmp.dim_ads_midas_t_campaign_push_strategy\",\"collectTime\":null,\"fileDelimiter\":null,\"lastAccessTime\":null,\"previousMarker\":null,\"partitionKeyList\":[],\"columnList\":[{\"colType\":\"INT\",\"comment\":\"\",\"columnName\":\"id\"},{\"colType\":\"STRING\",\"comment\":\"策略id\",\"columnName\":\"name\"},{\"colType\":\"INT\",\"comment\":\"push 控量cap\",\"columnName\":\"push_limit\"},{\"colType\":\"INT\",\"comment\":\"push目标 1、reengagement拉活 2、cpi订单未归因拉活 3、cpi订单转化效果提升 3、\",\"columnName\":\"push_target\"},{\"colType\":\"INT\",\"comment\":\"状态：1 有效  -1 删除\",\"columnName\":\"status\"},{\"colType\":\"INT\",\"comment\":\"1、push目标策略 2、push id策略\",\"columnName\":\"strategy_type\"},{\"colType\":\"INT\",\"comment\":\"push id\",\"columnName\":\"push_id\"},{\"colType\":\"INT\",\"comment\":\"账户id\",\"columnName\":\"account_id\"},{\"colType\":\"INT\",\"comment\":\"创建者id\",\"columnName\":\"create_user_id\"},{\"colType\":\"INT\",\"comment\":\"修改人id\",\"columnName\":\"modify_user_id\"},{\"colType\":\"STRING\",\"comment\":\"创建时间\",\"columnName\":\"create_time\"},{\"colType\":\"STRING\",\"comment\":\"修改时间\",\"columnName\":\"modify_time\"}],\"updateTime\":\"2025-06-05 19:34:36\",\"userName\":null,\"userId\":null,\"keyWord\":null,\"tagList\":null,\"secondaryKeywords\":null,\"createBy\":null,\"application\":null,\"createTime\":\"2023-06-08 03:20:48\",\"keyWordForSearch\":null,\"storageType\":\"S3\",\"location\":\"s3://shareit.ads.ap-southeast-1/dw/table/dim/dim_ads_midas_t_campaign_push_strategy_part/dt=2025021010\",\"categoryId\":null,\"fileFormat\":\"S3,parquet\",\"updateType\":null},\"limit\":0,\"page\":0,\"message\":\"success\"}'\n",
    "a = '{\"total\":0,\"code\":0,\"data\":{\"byteSize\":null,\"userGroupUUid\":null,\"lastActivityCount\":null,\"subject\":null,\"dbName\":\"ads_dmp\",\"num\":null,\"dbTable\":null,\"targetTagName\":null,\"clearCache\":null,\"type\":null,\"latestPartitionName\":null,\"tableName\":\"dim_ads_midas_t_campaign_push_strategy\",\"lifecycle\":0,\"score\":null,\"partitionCount\":null,\"userList\":null,\"hierarchical\":null,\"limit\":0,\"id\":null,\"partitionKeys\":null,\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"listCategory\":null,\"listModel\":null,\"targetModelCategoryId\":null,\"recentVisitCount\":null,\"sdFileFormat\":null,\"count\":null,\"targetTagCategoryId\":null,\"sort\":null,\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"partitionType\":0,\"tags\":null,\"catalogName\":\"shareit_sg1\",\"cnName\":null,\"size\":null,\"name\":\"dim_ads_midas_t_campaign_push_strategy\",\"interval\":null,\"page\":0,\"pageToken\":null,\"region\":\"sg1\",\"collect\":null,\"status\":0,\"sourceTagCategoryId\":null,\"useDirection\":null,\"flag\":0,\"numRows\":null,\"listTag\":null,\"columns\":\"[]\",\"description\":\"\",\"createType\":0,\"title\":null,\"sql\":null,\"securityLevel\":null,\"sourceModelCategoryId\":null,\"tableType\":\"外部表\",\"nextMarker\":null,\"columnsObj\":null,\"partitionKeysObj\":null,\"tenantName\":null,\"provider\":\"Hive\",\"transientLastDdlTime\":null,\"columnsList\":null,\"key\":\"sg1.ads_dmp.dim_ads_midas_t_campaign_push_strategy\",\"owner\":\"qijuhong\",\"sole\":\"sg1.ads_dmp.dim_ads_midas_t_campaign_push_strategy\",\"collectTime\":null,\"fileDelimiter\":null,\"lastAccessTime\":null,\"previousMarker\":null,\"partitionKeyList\":[],\"columnList\":[{\"colType\":\"INT\",\"comment\":\"\",\"columnName\":\"id\"},{\"colType\":\"STRING\",\"comment\":\"策略id\",\"columnName\":\"name\"},{\"colType\":\"INT\",\"comment\":\"push 控量cap\",\"columnName\":\"push_limit\"},{\"colType\":\"INT\",\"comment\":\"push目标 1、reengagement拉活 2、cpi订单未归因拉活 3、cpi订单转化效果提升 3、\",\"columnName\":\"push_target\"},{\"colType\":\"INT\",\"comment\":\"状态：1 有效  -1 删除\",\"columnName\":\"status\"},{\"colType\":\"INT\",\"comment\":\"1、push目标策略 2、push id策略\",\"columnName\":\"strategy_type\"},{\"colType\":\"INT\",\"comment\":\"push id\",\"columnName\":\"push_id\"},{\"colType\":\"INT\",\"comment\":\"账户id\",\"columnName\":\"account_id\"},{\"colType\":\"INT\",\"comment\":\"创建者id\",\"columnName\":\"create_user_id\"},{\"colType\":\"INT\",\"comment\":\"修改人id\",\"columnName\":\"modify_user_id\"},{\"colType\":\"STRING\",\"comment\":\"创建时间\",\"columnName\":\"create_time\"},{\"colType\":\"STRING\",\"comment\":\"修改时间\",\"columnName\":\"modify_time\"}],\"updateTime\":\"2025-06-05 19:34:36\",\"userName\":null,\"userId\":null,\"keyWord\":null,\"tagList\":null,\"secondaryKeywords\":null,\"createBy\":null,\"application\":null,\"createTime\":\"2023-06-08 03:20:48\",\"keyWordForSearch\":null,\"storageType\":\"S3\",\"location\":\"s3://shareit.ads.ap-southeast-1/dw/table/dim/dim_ads_midas_t_campaign_push_strategy_part/dt=2025021010\",\"categoryId\":null,\"fileFormat\":\"S3,parquet\",\"updateType\":null},\"limit\":0,\"page\":0,\"message\":\"success\"}'\n",
    "a = '{\"total\":0,\"listTag\":null,\"columns\":\"[{\\\"name\\\":\\\"id\\\",\\\"comment\\\":\\\"\\\",\\\"type\\\":\\\"INT\\\"}]\",\"description\":\"\"}'\n",
    "json.loads(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "8d88d277-49e6-4155-9ca2-b4d604081fd7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'total': 0,\n",
       " 'listTag': None,\n",
       " 'columns': '[{\"name\":\"id\",\"comment\":\"\",\"type\":\"INT\"}]',\n",
       " 'description': ''}"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "json.loads(r'{\"total\":0,\"listTag\":null,\"columns\":\"[{\\\"name\\\":\\\"id\\\",\\\"comment\\\":\\\"\\\",\\\"type\\\":\\\"INT\\\"}]\",\"description\":\"\"}')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "66082bbb-1846-4c96-bce0-468ba72b4eca",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'total': 0, 'listTag': None, 'columns': '[{\"}]', 'description': ''}"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "json.loads('{\"total\":0,\"listTag\":null,\"columns\":\"[{\\\\\"}]\",\"description\":\"\"}')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "33de740a-e5a7-4bf9-83f0-df46f81761c1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'total': 0, 'listTag': None, 'columns': '[{\"}]', 'description': ''}"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "json.loads(r'{\"total\":0,\"listTag\":null,\"columns\":\"[{\\\"}]\",\"description\":\"\"}')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "0c04d9cd-6711-450f-94f8-69bf0890f3ec",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'{\"total\":0,\"listTag\":null,\"columns\":\"[{\\\\\\\\\"}]\",\"description\":\"\"}'"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r'{\"total\":0,\"listTag\":null,\"columns\":\"[{\\\\\"}]\",\"description\":\"\"}'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "06935ef4-14e8-494c-a72f-8894fea8ac89",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "temp_adx_creatives_data [{'columnName': 'dsp', 'colType': 'STRING', 'comment': 'dsp'}, {'columnName': 'bundle', 'colType': 'STRING', 'comment': '投放的包名名称'}, {'columnName': 'country', 'colType': 'STRING', 'comment': '国家'}, {'columnName': 'crid', 'colType': 'STRING', 'comment': '广告创意ID'}, {'columnName': 'ad_type', 'colType': 'STRING', 'comment': '广告类型，枚举值 1 banner 2 native 3 video 4 js_tag'}, {'columnName': 'flag', 'colType': 'STRING', 'comment': '标志 1 内部流量 2 adx外部流量'}, {'columnName': 'c_size', 'colType': 'STRING', 'comment': '广告尺寸'}, {'columnName': 'title', 'colType': 'STRING', 'comment': '广告包爬取的标题'}, {'columnName': 'os_platform', 'colType': 'STRING', 'comment': '操作系统平台'}, {'columnName': 'tags', 'colType': 'STRING', 'comment': '爬取的广告主包的标签'}, {'columnName': 'google_rate_score', 'colType': 'DECIMAL(4,2)', 'comment': 'Google评分'}, {'columnName': 'bundle_discription', 'colType': 'STRING', 'comment': '爬取的广告主包的描述'}, {'columnName': 'category', 'colType': 'STRING', 'comment': '爬取的广告主包的类别'}, {'columnName': 'category_alias', 'colType': 'STRING', 'comment': '爬取的广告主包的类别别名'}, {'columnName': 'icon', 'colType': 'STRING', 'comment': '爬取的广告主包的图标'}, {'columnName': 'cover', 'colType': 'STRING', 'comment': '爬取的广告主包的封面'}, {'columnName': 'imp_num', 'colType': 'BIGINT', 'comment': '展示次数'}, {'columnName': 'click_num', 'colType': 'BIGINT', 'comment': '点击次数'}, {'columnName': 'landing_page_is_gp_url', 'colType': 'STRING', 'comment': '着陆页是否为Google Play URL'}, {'columnName': 'bid_adm', 'colType': 'STRING', 'comment': '素材信息'}, {'columnName': 'creative_sizes_url', 'colType': 'STRING', 'comment': '创意尺寸URL'}, {'columnName': 'creative_title', 'colType': 'STRING', 'comment': '创意标题'}, {'columnName': 'creative_describe', 'colType': 'STRING', 'comment': '创意描述'}]\n"
     ]
    }
   ],
   "source": [
    "file_name='/Users/dob/develop/var/sync/nut/我的坚果云/work/01工作文档/09-工程开发/datacake/从datacake接口获取表的字段信息-20250605/tables-ads_dmp-20250605-dc_result.txt'\n",
    "file_name='/Users/dob/develop/var/sync/nut/我的坚果云/work/01工作文档/09-工程开发/datacake/从datacake接口获取表的字段信息-20250605/test.txt'\n",
    "columns=[]\n",
    "tableName=''\n",
    "with open(file_name,'r') as fr:\n",
    "    for line in fr.readlines():\n",
    "        aaa=json.loads(line.strip())\n",
    "        tableName=aaa['data']['tableName']\n",
    "        for col in aaa['data']['columnList']:\n",
    "            columns.append({\n",
    "                'columnName': col.get('columnName', ''),\n",
    "                'colType': col.get('colType', ''),\n",
    "                'comment': col.get('comment', '')\n",
    "            })\n",
    "\n",
    "print(tableName,columns)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "723eecda-1b39-4187-a29c-7c8a0508844d",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
